package com.twu.biblioteca;

public class OptionMembership implements Option {

    public OptionMembership() {}

    @Override
    public Object run(User user) {

        if (user == null) {
            printMembershipFailure();
        }
        else {
            printMembership(user);
        }

        return null;
    }

    private void printMembershipFailure() {
        System.out.println("Please talk to a Librarian. Thank you.");
    }

    private void printMembership(User user) {
        System.out.print(user.membershipString());
    }

    public String menuDescription() {
        return "Check membership";
    }
}